Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve hostname colorization #475

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ultravail
Copy link

@ultravail ultravail commented Sep 20, 2019

There are 2 changes included:

a) The function getOppositeColor in color_compliment.py did not work properly. It was mixing value ranges from 0-1 and ranges from 0-255.

b) When hostname colorization is enabled, then a random number is being generated for the foreground color of the hostname and the opposite color is being calculated for the background color.

However, when running in a shell with dark background color it typically looks better if the background color of the hostname is "bright". So I introduced a noption in the configuration named "hostname.dark" that (when set to true) picks the brighter of the two colors for the hostname as the background color (by swapping the two if the foreground color is the brighter one in the first place).

The function getOppositeColor in color_compliment.py
did not work properly. It was mixing value ranges
from 0-1 and ranges from 0-255
When hostname colorization is enabled, then a
random number is being generated for the foreground
color of the hostname and the opposite color is
being calculated for the background color.

When running in a shell with dark background color
it typically looks better if the background color
of the hostname is "bright". So I introduced an
option in the configuration named "hostname.dark"
that (when set to true) picks the brighter of the
two colors for the hostname as the background color.
@Nicholas-Autio-Mitchell

This would be great to have... I keep getting unreadable hostnames, making this functionality useless.

@b-ryan (or other maintainers) - any reason this isn't being merged?

@CWempe
Copy link

CWempe commented Jan 10, 2020

I have the same issue with unreadable hostnames.
But I am not sure if this PR solves this.

You might take a look at this issue. #381

The initial fix unnecessarily divided RGB values by 255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants